<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "position".
 *
 * @property integer $id
 * @property string $name
 * @property string $number
 * @property integer $parent_id
 * @property string $parent_number
 * @property string $parent_name
 * @property string $domain
 * @property integer $department_id
 * @property string $department_number
 * @property string $department_name
 * @property string $department_display_name
 * @property string $kd_id
 * @property string $parent_kd_id
 * @property string $department_kd_id
 * @property string $mdm_id
 * @property integer $mdm_status
 * @property string $created_by
 * @property string $created_at
 * @property string $updated_by
 * @property string $updated_at
 */
class Position extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'position';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name'], 'required'],
            [['parent_id', 'department_id', 'mdm_status'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['name', 'number', 'parent_name', 'domain', 'department_name'], 'string', 'max' => 255],
            [['parent_number', 'department_number', 'kd_id', 'parent_kd_id', 'department_kd_id', 'mdm_id', 'created_by', 'updated_by'], 'string', 'max' => 45],
            [['department_display_name'], 'string', 'max' => 1024],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'name' => Yii::t('app', 'Name'),
            'number' => Yii::t('app', 'Number'),
            'parent_id' => Yii::t('app', 'Parent ID'),
            'parent_number' => Yii::t('app', 'Parent Number'),
            'parent_name' => Yii::t('app', 'Parent Name'),
            'domain' => Yii::t('app', 'Domain'),
            'department_id' => Yii::t('app', 'Department ID'),
            'department_number' => Yii::t('app', 'Department Number'),
            'department_name' => Yii::t('app', 'Department Name'),
            'department_display_name' => Yii::t('app', 'Department Display Name'),
            'kd_id' => Yii::t('app', 'Kd ID'),
            'parent_kd_id' => Yii::t('app', 'Parent Kd ID'),
            'department_kd_id' => Yii::t('app', 'Department Kd ID'),
            'mdm_id' => Yii::t('app', 'Mdm ID'),
            'mdm_status' => Yii::t('app', 'Mdm Status'),
            'created_by' => Yii::t('app', 'Created By'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}
